Introduction
This R Markdown report enables to analyze time series from Yahoo Finance of userâs choice. The report takes user input and creates tables, plots and tests based on that input and allows to thoroughly analyze different quotes and time spans without interfering with the code.
This version of report provides several tech and motor companies to choose from, however, should one want to analyze another, he/she should add the abbreviation and companyâs full name to the parameterâs choice list and dictionary and the report would be good to go. Default time range spans back a thousand days from the day of running the report. Should the multiple choice for the quotes be left empty, then as default, all prices are included in the analysis. Last parameter determines the forecast period in days.
Data
Gathering of the time series data is performed via getSymbols function provided in quantmod package. More information about the package can be found here. Data used in this particular report is characterized by following parameters:
- Company name:
NVIDIA Corporation - Company abbreviation:
NVDA - Time span:
2021-05-20-2021-06-01 - Quotes:
None - Simulation paths:
13
Below you can see a glimpse of the first and last few observations of the data of your choice. There are 7 observations in total.
| Date | NVDA.Open | NVDA.High | NVDA.Low | NVDA.Close | NVDA.Adjusted | NVDA.Volume |
|---|---|---|---|---|---|---|
| 2021-05-28 | 620.04 | 651.10 | 620.04 | 649.78 | 649.78 | 16 089 300 |
| 2021-05-27 | 627.99 | 630.00 | 618.40 | 619.52 | 619.52 | 14 536 900 |
| 2021-05-26 | 629.37 | 631.75 | 623.45 | 628.00 | 628.00 | 9 261 000 |
| 2021-05-25 | 630.64 | 632.74 | 619.30 | 625.91 | 625.91 | 10 885 200 |
| 2021-05-24 | 608.50 | 629.80 | 607.04 | 624.48 | 624.48 | 13 870 400 |
| 2021-05-21 | 606.55 | 608.88 | 594.78 | 599.67 | 599.67 | 16 799 900 |
| Date | NVDA.Open | NVDA.High | NVDA.Low | NVDA.Close | NVDA.Adjusted | NVDA.Volume |
|---|---|---|---|---|---|---|
| 2021-05-27 | 627.99 | 630.00 | 618.40 | 619.52 | 619.52 | 14 536 900 |
| 2021-05-26 | 629.37 | 631.75 | 623.45 | 628.00 | 628.00 | 9 261 000 |
| 2021-05-25 | 630.64 | 632.74 | 619.30 | 625.91 | 625.91 | 10 885 200 |
| 2021-05-24 | 608.50 | 629.80 | 607.04 | 624.48 | 624.48 | 13 870 400 |
| 2021-05-21 | 606.55 | 608.88 | 594.78 | 599.67 | 599.67 | 16 799 900 |
| 2021-05-20 | 572.10 | 587.35 | 570.82 | 584.50 | 584.50 | 8 039 800 |
Descriptive statistics
General
Below you can find a handful of descriptive statistics regarding the columns specified during knitting. Maximum price recorded for NVIDIA Corporation during 2021-05-20 - 2021-06-01 period was $651.1, while the minimum was $19.05. Number of observations between the dates is equal to 7.
| Variable | Mean | Std. | Min | 1st quartile | Median | 3rd quartile | Max |
|---|---|---|---|---|---|---|---|
| NVDA.Open | 613.60 | 20.76 | 572.10 | 607.52 | 620.04 | 628.68 | 630.64 |
| NVDA.High | 624.52 | 20.46 | 587.35 | 619.34 | 630.00 | 632.24 | 651.10 |
| NVDA.Low | 607.69 | 19.05 | 570.82 | 600.91 | 618.40 | 619.67 | 623.45 |
| NVDA.Close | 618.84 | 21.10 | 584.50 | 609.60 | 624.48 | 626.95 | 649.78 |
| NVDA.Adjusted | 618.84 | 21.10 | 584.50 | 609.60 | 624.48 | 626.95 | 649.78 |
| NVDA.Volume | 12 783 214.29 | 3 411 494.88 | 8 039 800.00 | 10 073 100.00 | 13 870 400.00 | 15 313 100.00 | 16 799 900.00 |
Log returns
This chapter provides insight on the log returns of selected prices. Log returns are more widely used in finance than simple returns for a number of reasons, one being that prices are assumed to be log-normally distributed. That is not always the case as can be seen on the graphs below. Nevertheless, this assumption results in logarithms of prices to be normally distributed. More information on this topic can be found here.
Each of the graphs below represents a histogram of log returns of certain price, as well as kernel density estimate (white line). It is plotted agains a normal distribution (red line) with mean and standard deviation calculated separately for each graph.
NVDA.Open
NVDA.High
NVDA.Low
NVDA.Close
NVDA.Adjusted
Plotting
This chapter provides graphical visualisation of the data. The graph is made using ggplotly package and enables user to zoom, pan, hover over observations to obtain tooltip info and more. Number of columns that are displayed on the graph is equal to 6 and should the Volume column have been selected, it would appear on a separate graph below the price graph. In case it has not been chosen, only price graph would appear. Nevertheless, both graphs have the same functionalities.
Stationarity analysis
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
## [1] "Too few observations to conduct stationarity testing."
## [1] "Data should have at least 15 observations, which is roughly 3 weeks."
## [1] "Time span you selected had 7 observations."
Trend
According to the ADF test the series are integrated of order N/A, or in other words have become stationary after N/A differentiation(s). The program differentiated the series until it found order where value of test-statistic: N/A is smaller than tau3 5pct: N/A.
Drift
According to the ADF test the series are integrated of order N/A, or in other words have become stationary after N/A differentiation(s). The program differentiated the series until it found order where value of test-statistic: N/A is smaller than tau3 5pct: N/A.
None
According to the ADF test the series are integrated of order N/A, or in other words have become stationary after N/A differentiation(s). The program differentiated the series until it found order where value of test-statistic: N/A is smaller than tau3 5pct: N/A.
Simulation
ARMA(1,1)-GARCH(1,1)
## [1] "Too few observations to conduct meaningful GARCH simulations."
## [1] "Data should have at least 100 observations, which is roughly 5 months."
## [1] "Time span you selected had 7 observations."
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.